<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>理解引用类型</title>
</head>
<body>
<script>
    function test(arr,str){
        arr[0]=5;
        str=new String('world');  // str 先指向strs指向的地址，现在指向新地址，strs的指向未变
    }
    var arr1=[1,2,3];
    var strs=new String('hello');
    test(arr1,strs);
    alert(arr1[0]);
    alert(strs);
</script>
</body>
</html>